package sk.fei.vrml.main;

import sk.fei.vrml.gui.MainFrame;

public class Transformator {
	private static MainFrame window;
	
	public static void setTransformator(MainFrame w){
		window = w;
	}
	
	public static float transformCordsToFloat(int x){
		float y = (float)x/(window.getCanvas().getWidth()/200)/100;
		return y;
	}
	
	public static float transformXCordsToFloat(int x){
		float y = (float)x/(window.getCanvas().getWidth()/200)/100;
		return y;
	}
	
	public static float transformYCordsToFloat(int x){
		float y = (float)x/(window.getCanvas().getHeight()/200)/100;
		return y;
	}
	
	
	public static float transformXPositionToCords(int x){
		float y;
		y = ((float)x-(float)(window.getCanvas().getWidth()/2))/((float)window.getCanvas().getWidth()/2);
		return y;
	}
	
	public static float transformYPositionToCords(int x){
		float y;
		y = -((float)x-(float)(window.getCanvas().getHeight()/2))/((float)window.getCanvas().getHeight()/2);
		return y;
	}
}
